<template>
  <div class="app-container">
  <!-- 嵌入知乎网页，并删除边框和滚动条 -->
    <iframe :src="AiConfig.aiPlaneUrl" frameborder="0" width="100%" :style="{ height: iframeHeight + 'px' }"></iframe>
  </div>
</template>

<script>
import { getAiconfig } from "@/api/aiconfig/aiconfig.js";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import mixin from "./mixin";

export default {
  mixins: [mixin],
  name: "Dept",
  dicts: ['sys_normal_disable'],
  components: { Treeselect },
  data() {
    return {
      AiConfig: {
        aiChatUrl: "",
        aiPlaneUrl: ""
      },
    };
  },
  // mounted() {
  //   const webui = this.$refs.webui
  //   webui.addEventListener("load", function () {
  //     // 获取iframe中的document对象
  //     const iframeDoc = webui.contentWindow.document;
  //
  //     iframeDoc.querySelector("#tabs > .tab-nav > button:last-child").style.display = "none";
  //   });
  // },
  created() {
    this.getAiconfigInfo();
  },
  methods: {
    getAiconfigInfo() {
      getAiconfig().then(res => {
      this.AiConfig.aiChatUrl = res.data.aiChatUrl;
      this.AiConfig.aiPlaneUrl = res.data.aiPlaneUrl;
      });
    },

  }
};
</script>
